import { Space_GreenHouseRenderData, Space_FieldRenderData } from '../SpaceAssembler';

export function getGreenHouseStructureDatas(): Space_GreenHouseRenderData[] {
  return [
    {
      id: 1,
      proofType: 'round',
      enableWetCurtain: true,
      scale: {
        x: 1,
        y: 1.5,
        z: 2,
      },
      sideTextureArr: [
        {
          sideTypeKey: 'front',
          url: '3D/building/glass_frontBack.png',
          opacity: 0.5,
        },
        {
          sideTypeKey: 'right',
          url: '3D/building/new/gangjia.png',
          opacity: 0.8,
        },
      ],
      preloadCropPlotRawDatas: getCropPlotDatas(),
      preloadDeviceRawDatas: getDeviceDatas(),
      preloadCropRackRawDatas: getCropRackDatas(),
    },
    {
      id: 2,
      pos: {
        position: { x: 500, y: 0, z: 0 },
      },
      proofType: 'round',
      enableWetCurtain: false,
      scale: {
        x: 1,
        y: 1.5,
        z: 2,
      },
      sideTextureArr: [
        {
          sideTypeKey: 'front',
          url: '3D/building/glass_frontBack.png',
          opacity: 0.5,
        },
        {
          sideTypeKey: 'back',
          url: '3D/building/glass_frontBack.png',
          opacity: 0.5,
        },
        {
          sideTypeKey: 'right',
          url: '3D/building/new/gangjia.png',
          opacity: 0.8,
        },
        {
          sideTypeKey: 'left',
          url: '3D/building/new/gangjia.png',
          opacity: 0.8,
        },
      ],

      preloadCropPlotRawDatas: getCropPlotDatas(),
      preloadDeviceRawDatas: getDeviceDatas(),
    },
    {
      id: 3,
      pos: {
        position: { x: 1000, y: 0, z: 0 },
        quaternion: {
          x: 0,
          y: -0.7071067811865475,
          z: 0,
          w: 0.7071067811865476,
        },
      },
      proofType: 'tip',
      enableWetCurtain: false,
      scale: {
        x: 1,
        y: 1.5,
        z: 2,
      },
      sideTextureArr: [
        {
          sideTypeKey: 'front',
          url: '3D/building/glass_frontBack.png',
          opacity: 0.5,
        },
      ],
      preloadDeviceRawDatas: getDeviceDatas(),
    },
  ];
}

export function getFieldDatas(): Space_FieldRenderData[] {
  return [
    {
      id: 1,
      url: '3D/field/field1.fbx',
      pos: {
        position: { x: 0, y: 0, z: 300 },
      },
      scale: {
        base: 1.5,
        x: 1,
        y: 1,
        z: 1,
      },
      preloadCropPlotRawDatas: getCropPlotDatas(),
      preloadDeviceRawDatas: [
        {
          id: 1751442144946,
          type: 'insideDevice',
          url: '3D/device/waterValve.fbx',
          scale: {
            base: 0.05,
            x: 1,
            y: 1,
            z: 1,
          },
          pos: {
            position: {
              x: 500,
              y: 10,
              z: -10,
            },
            quaternion: {
              x: 0.7071067811865475,
              y: 0,
              z: 0,
              w: 0.7071067811865476,
            },
          },
        },
      ],
    },
    // {
    //   id: 2,
    //   pos: {
    //     position: { x: 500, y: 0, z: 0 },
    //   },
    //   url: '3D/field/field1.fbx',
    //   scale: {
    //     base: 1.5,
    //     x: 2,
    //     y: 1,
    //     z: 2,
    //   },
    // },
  ];
}

export function getCropPlotDatas(): Editor.CropPlotSaveData[] {
  return [
    {
      data: {
        id: 1750323040203,
      },
      cropModelInfo: {
        url: '3D/carrot.fbx',
        scale: 0.8,
      },
      pointArr: [
        {
          x: 0.02361295493787556,
          y: 0.034270897415106215,
        },
        {
          x: 0.3274849978961298,
          y: 0.034270897415106215,
        },
        {
          x: 0.3274849978961298,
          y: 0.5342708974151062,
        },
        {
          x: 0.02361295493787556,
          y: 0.5342708974151062,
        },
      ],
    },
    {
      data: {
        id: 1750323042734,
      },
      cropModelInfo: {
        url: null,
      },
      pointArr: [
        {
          x: 0.6667064160039189,
          y: 0.4643637285179008,
        },
        {
          x: 0.9705784589621731,
          y: 0.4643637285179008,
        },
        {
          x: 0.9705784589621731,
          y: 0.9643637285179008,
        },
        {
          x: 0.6667064160039189,
          y: 0.9643637285179008,
        },
      ],
    },
  ];
}

export function getCropRackDatas(): Editor.CropRackSaveData[] {
  return [
    {
      id: 1751597144312,
      url: '3D/rack/rack.fbx',
      scale: {
        base: 0.8,
      },
      cropModelInfo: {
        url: '3D/carrot.fbx',
        scale: 0.8,
      },
      pos: {
        position: {
          x: 80,
          y: 0,
          z: -412.51194684973194,
        },
        quaternion: {
          x: 0,
          y: -0.7071067811865475,
          z: 0,
          w: 0.7071067811865476,
        },
      },
    },
  ];
}

export function getDeviceDatas(): Editor.DeviceSaveData[] {
  return [
    {
      id: 1750475904754,
      type: 'sideDevice',
      sideType: 'front',
      url: '3D/device/condition.fbx',
      scale: {
        base: 1.2,
        x: 1,
        y: 1,
        z: 1,
      },
      pos: {
        position: {
          x: 330.7755727452999,
          y: 276.25263272225,
          z: -2.5000300420973813,
        },
        quaternion: {
          x: 0,
          y: -1,
          z: 0,
          w: 6.123233995736766e-17,
        },
      },
    },
    {
      id: 1750475869258,
      type: 'sideDevice',
      sideType: 'left',
      url: '3D/device/condition.fbx',
      scale: {
        base: 1.2,
        x: 1,
        y: 1,
        z: 1,
      },
      pos: {
        position: {
          x: 3.8079715333878994,
          y: 303.82626489757547,
          z: -306.1991274029005,
        },
        quaternion: {
          x: 0,
          y: 0.7071067811865475,
          z: 0,
          w: 0.7071067811865476,
        },
      },
    },
    {
      id: 1751442144946,
      type: 'insideDevice',
      url: '3D/device/waterValve.fbx',
      scale: {
        base: 0.1,
        x: 1,
        y: 1,
        z: 1,
      },
      pos: {
        position: {
          x: 720.9446621905315,
          y: 10,
          z: -75.4948086142071,
        },
        quaternion: {
          x: 0.7071067811865475,
          y: 0,
          z: 0,
          w: 0.7071067811865476,
        },
      },
    },
  ];
}
